//
//  KLPopverViewController.swift
//  BCWeiBo
//
//  Created by bcmac3 on 16/3/31.
//  Copyright © 2016年 KellenYangs. All rights reserved.
//

import UIKit

class FriendGroupViewController: UIViewController {

    @IBOutlet weak private var backgroundImgv: UIImageView!
    
    @IBOutlet weak private var friendGroupTableView: UITableView!
    
    private let identity: String = "customCell"
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // 1. 设置背景图片拉升样式
        setupBackgroundImgv()
        
    }
    
    private func setupBackgroundImgv()
    {
        var img: UIImage = UIImage(named: "popover_background")!
        let h = img.size.height * 0.5
        img = img.resizableImageWithCapInsets(UIEdgeInsets(top: h * 0.5, left: 0, bottom: h, right: 0), resizingMode: .Stretch)
        backgroundImgv.image = img
    }
}

extension FriendGroupViewController: UITableViewDataSource
{
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10;
    }
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(identity)!
        cell.textLabel!.text = "第\(indexPath.row)行"
        return cell
    }
}